package com.coderdream.chapter13.visitor.sample;

import java.util.Iterator;

public abstract class Entry implements Acceptor {
	public abstract String getName();// 取得文件名

	public abstract int getSize();// 取得文件容量

	/**
	 * 新增進入點
	 * 
	 * @param entry
	 * @return
	 * @throws FileTreatmentException
	 */
	public Entry add(Entry entry) throws FileTreatmentException {
		throw new FileTreatmentException();
	}

	/**
	 * 產生Iterator
	 * 
	 * @return
	 * @throws FileTreatmentException
	 */
	public Iterator iterator() throws FileTreatmentException {
		throw new FileTreatmentException();
	}

	/**
	 * 印出字符串
	 */
	public String toString() {
		return this.getName() + " (" + this.getSize() + ")";
	}
}
